---
title: transformAsync
description: Creates a custom transformation action.
source: /actions/transform/transformAsync.ts
contributors:
  - fabian-hiller
  - EltonLobo07
  - santoshyadavdev
---

import { ApiList, Link, Property } from '~/components';
import { properties } from './properties';

# transformAsync

Creates a custom transformation action.

```ts
const Action = v.transformAsync<TInput, TOutput>(operation);
```

## Generics

- `TInput` <Property {...properties.TInput} />
- `TOutput` <Property {...properties.TOutput} />

## Parameters

- `operation` <Property {...properties.operation} />

### Explanation

`transformAsync` can be used to freely transform the input. The `operation` parameter is a function that takes the input and returns the transformed output.

## Returns

- `Action` <Property {...properties.Action} />

## Examples

The following examples show how `transformAsync` can be used.

### Blob to string

Schema that transforms a blob to its string value.

```ts
const StringSchema = v.pipeAsync(
  v.blob(),
  v.transformAsync((value) => value.text())
);
```

## Related

The following APIs can be combined with `transformAsync`.

### Schemas

<ApiList
  items={[
    'any',
    'array',
    'bigint',
    'blob',
    'boolean',
    'custom',
    'date',
    'enum',
    'exactOptional',
    'file',
    'function',
    'instance',
    'intersect',
    'lazy',
    'literal',
    'looseObject',
    'looseTuple',
    'map',
    'nan',
    'never',
    'nonNullable',
    'nonNullish',
    'nonOptional',
    'null',
    'nullable',
    'nullish',
    'number',
    'object',
    'objectWithRest',
    'optional',
    'picklist',
    'promise',
    'record',
    'set',
    'strictObject',
    'strictTuple',
    'string',
    'symbol',
    'tuple',
    'tupleWithRest',
    'undefined',
    'undefinedable',
    'union',
    'unknown',
    'variant',
    'void',
  ]}
/>

### Utils

<ApiList items={['isOfKind', 'isOfType']} />

### Async

<ApiList
  items={[
    'arrayAsync',
    'awaitAsync',
    'customAsync',
    'exactOptionalAsync',
    'intersectAsync',
    'lazyAsync',
    'looseObjectAsync',
    'looseTupleAsync',
    'mapAsync',
    'nonNullableAsync',
    'nonNullishAsync',
    'nonOptionalAsync',
    'nullableAsync',
    'nullishAsync',
    'objectAsync',
    'objectWithRestAsync',
    'optionalAsync',
    'pipeAsync',
    'recordAsync',
    'setAsync',
    'strictObjectAsync',
    'strictTupleAsync',
    'tupleAsync',
    'tupleWithRestAsync',
    'undefinedableAsync',
    'unionAsync',
    'variantAsync',
  ]}
/>
